Skip to content

Add initialValues option to toggle use of type specific initial values #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 17, 2025

Conversation

manisatwick
Copy link
Contributor

Add initialValues template option , set to false to not use type specific initial values.Defaults to true

@manisatwick manisatwick changed the title Add initialValues option to turn on/off value generation Add initialValues option to toggle use of type specific initial values Jun 27, 2025
@manisatwick
Copy link
Contributor Author

Hi @sagold , Can you please look into the PR and let me know your comments. This enables to control the inclusion of type specific values in getData response

@sagold
Copy link
Owner

sagold commented Jul 2, 2025

Hi Mani,

thank you for your PR! I am waiting for some spare time review your MR.

Cheers,
Sascha

@manisatwick
Copy link
Contributor Author

Hi @sagold,

Could you please review the merge request at your earliest convenience? I'm currently waiting on this change to proceed further.

Thanks in advance!
Best,
Mani

@manisatwick
Copy link
Contributor Author

Hi @sagold ,
Can you please review the merge request ?

Thanks,
Mani

@sagold
Copy link
Owner

sagold commented Jul 28, 2025

Hi Mani,

FYI I will do so this week.

Cheers,
Sascha

@manisatwick
Copy link
Contributor Author

Thanks @sagold , waiting for it 🙂 .

@sagold
Copy link
Owner

sagold commented Aug 3, 2025

Overall I agree with this merge request. This feature is likely to changed in the future in favor of a more consistent configuration (between required, optional properties, valid and invalid default values and now our new option). But right now, I am happy that you addressed this missing requirement and happy to change the api to support this.

Please note:

  • as mentioned above, we can do better with the naming of the option
  • all tests must pass (yarn test). For some reason your branch fails for draft tests. Unfortunately this is not yet done for MR.
  • With dynamic schemas there is potential for gaps of this option - we should keep an eye on this

Cheers.
Sascha

@manisatwick
Copy link
Contributor Author

Hi Sascha,
I have found the issue and now tests are passing. Also renamed the option as useTypeDefaults . Can you please review and let me know if further changes are required.

Thanks,
Mani

@sagold
Copy link
Owner

sagold commented Aug 17, 2025

Hi Mani,

thank you for the update! I merge and publish your PR. Tests are passing on my side. An update of the documentation is missing, but I will add it myself to not further delay the PR.

Regards,
Sascha

@sagold sagold merged commit 19ad300 into sagold:main Aug 17, 2025
1 of 6 checks passed
@sagold
Copy link
Owner

sagold commented Aug 17, 2025

Your changes have been published with v10.2.0. Also refer to the documentation here: https://github.com/sagold/json-schema-library?tab=readme-ov-file#getdata. Possible that we might to extend this new option to objects and arrays at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants